<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<ng-container *ngIf="_isEmpty(helpLabel)">
</ng-container>
<ng-container *ngIf="action === detectionCopyAction.FeedbackSelect">
    <lv-tabs [(lvActiveIndex)]="activeIndex" (lvActiveIndexChange)="selectIndexChange($event)" [lvSize]="'small'">
        <lv-tab [lvTitle]="total" [lvId]="'total'">
            <ng-template lv-tab-lazy>
                <ng-container *ngTemplateOutlet="tableTpl;">
                </ng-container>
            </ng-template>
        </lv-tab>
        <lv-tab [lvTitle]='selected' [lvId]="'selected'">
            <ng-template lv-tab-lazy>
                <ng-container *ngTemplateOutlet="tableTpl;">
                </ng-container>
            </ng-template>
        </lv-tab>
    </lv-tabs>
    <ng-template #tableTpl>
        <lv-pro-table #dataTable [config]="tableConfig" [data]="tableData"></lv-pro-table>
    </ng-template>
    <ng-template #total>
        <div class="host-register-tabnav tabnav-font">
            <span>{{'common_total_label' | i18n}}</span>
            <span class="host-register-tabnav-num">{{currentTotal}}</span>
        </div>
    </ng-template>
    <ng-template #selected>
        <div class="host-register-tabnav tabnav-font">
            <span>{{'common_selected_label' | i18n}}</span>
            <span class="host-register-tabnav-num">{{currentSelect}}</span>
        </div>
    </ng-template>
</ng-container>

<ng-container *ngIf="action !== detectionCopyAction.FeedbackSelect">
    <div class="aui-operation">
        <lv-group>
            <ng-container *ngIf="isDataBackup">
                <button lv-button (click)="deleteCopyData()" [disabled]="deleteBtnDisable" pmpermission
                    pmOperation='DeletingCopy' *ngIf="action === detectionCopyAction.View">
                    {{ 'common_delete_label' | i18n }}
                </button>
            </ng-container>
        </lv-group>
        <lv-group lvGutter="8px">
            <lv-group lvGutter="8px">
                <button class="aui-button-icon" lv-button lvSize="auto" (click)="dataTable.fetchData()">
                    <i lv-icon="lv-icon-refresh" [lvColorState]="true"></i>
                </button>
            </lv-group>
        </lv-group>
    </div>
    <lv-pro-table #dataTable [config]="tableConfig" [data]="tableData"></lv-pro-table>
</ng-container>

<ng-template #feedbackTpl>
    <span [innerHTML]="feedbackTplLabel"></span>
    <ng-container *ngIf="isFeedback">
        <lv-form-item>
            <lv-form-label>
                {{'protection_lock_no_anti_data_label' | i18n}}
                <i lv-icon="aui-icon-help" lv-tooltip="{{'explore_anti_dynamic_detection_label' | i18n}}"
                     class="configform-constraint" lvColorState='true'></i>
            </lv-form-label>
            <lv-form-control>
                <lv-switch [(ngModel)]="isSecuritySnap"></lv-switch>
            </lv-form-control>
        </lv-form-item>
    </ng-container>
    <div class="warning-checkbox">
        <label lv-checkbox [(ngModel)]="isRead">
            {{ 'common_warning_confirm_label' |i18n }}
        </label>
    </div>
</ng-template>
